package application;

import java.awt.*;
import javax.swing.*;
 
public class ImagePanel extends JPanel
 {
   public Image image;
   public String chemin;
 
   public ImagePanel(String s)
   {
     image = Toolkit.getDefaultToolkit().getImage(s);
   }
 
   public void paintComponent(Graphics g)
   {
     super.paintComponent(g);
 
     int imageWight = image.getWidth(this);
     int imageHeight = image.getHeight(this);
 
     g.drawImage (image, 0, 0, null);
     repaint();
   }

public String getChemin() {
	return chemin;
}

public void setChemin(String chemin) {
	this.chemin = chemin;
	 image = Toolkit.getDefaultToolkit().getImage(chemin);
}
  
   
   
 }